Skip to content

Conversation

@mfojtik
Copy link
Contributor

@mfojtik mfojtik commented Jun 26, 2017

Attempt to fix: https://bugzilla.redhat.com/show_bug.cgi?id=1463499 and ublock the possiblity of using DNS for the registry.

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 26, 2017

[test]

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 26, 2017

@miminar @dmage this basically removes the hardcoded defaults from the image and allows us to change it. The defaulting is done when the registry initializes so this won't be backward compatibility issue.

return nil, fmt.Errorf("%s variable must be set when running outside Kubernetes cluster", DockerRegistryURLEnvVar)
}
}
context.GetLogger(ctx).Infof("Using %q as Docker Registry URL", registryAddr)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will help with debuging :-)

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 26, 2017

@smarterclayton && others: why we have two variables here OPENSHIFT_DEFAULT_REGISTRY and this?

@miminar
Copy link

miminar commented Jun 26, 2017

[testextended][extended:core(registry|imageapi|ImagePrune|ImageQuota)]

if len(os.Getenv("DOCKER_REGISTRY_SERVICE_HOST")) > 0 && len(os.GetEnv("DOCKER_REGISTRY_SERVICE_PORT")) > 0 {
registryAddr = os.Getenv("DOCKER_REGISTRY_SERVICE_HOST") + ":" + os.Getenv("DOCKER_REGISTRY_SERVICE_PORT")
} else {
return nil, fmt.Errorf("%s variable must be set when running outside Kubernetes cluster", DockerRegistryURLEnvVar)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outside of

@mfojtik mfojtik force-pushed the registry-url branch 2 times, most recently from 552dc6e to 29dc955 Compare June 26, 2017 14:46
@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 26, 2017

@miminar made one more change. I deprecated the REGISTRY_DEFAULT_URL in favor of OPENSHIFT_DEFAULT_REGISTRY (i kept the old there for backward compatibility, but with warning). I also updated both Dockerfiles and tests.

@sdodson
Copy link
Member

sdodson commented Jun 26, 2017

If for some reason OPENSHIFT_DEFAULT_REGISTRY is not set this will still work based on IP, correct? Just want to make sure we can back out any changes in the installer at the last minute and still expect the old behavior to work.

context.GetLogger(ctx).Infof("DEPRECATED: %q is deprecated, use the %q instead", DockerRegistryURLEnvVar, OpenShiftDefaultRegistry)
}
if len(registryAddr) == 0 {
if len(os.Getenv("DOCKER_REGISTRY_SERVICE_HOST")) > 0 && len(os.GetEnv("DOCKER_REGISTRY_SERVICE_PORT")) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat challenging in the future - we don't want to call the service "docker-registry" forever. I expect both name of service and location of service to change in the future. Also, this is something that we typically inject, vs hardcoding. However, since it's a fallback, I'm ok with it. Leave a TODO "this may change"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, added todo. if this change we can still use the OPENSHIFT_DEFAULT_REGISTRY to set the hostname and the port as env variable.

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 27, 2017

compilation failure... re-[test]-ing

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 84a6d02

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 27, 2017

If for some reason OPENSHIFT_DEFAULT_REGISTRY is not set this will still work based on IP, correct? Just want to make sure we can back out any changes in the installer at the last minute and still expect the old behavior to work.

Yes, this has a fallback so nothing should break. If that variable is set for registry then the registry should create image streams with that URL (which should fix the BZ?). I think there might be a change needed on ansible side where we set that var for the registry (in registry DC).

So we have to set it on two places (for master and for registry). With this PR both vars should have the same name for the sake of consistency.

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 27, 2017

@miminar extended test passed :-)

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2680/) (Base Commit: 247631a) (PR Branch Commit: 84a6d02)

@miminar
Copy link

miminar commented Jun 27, 2017

extended test passed :-)

because they don't utilize the dns name? 😄

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 27, 2017

@miminar but it proves it does not break anything ;-) i'm going to run some tests locally

@openshift-bot
Copy link
Contributor

Evaluated for origin testextended up to 84a6d02

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/testextended FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_extended/760/) (Base Commit: bbb9647) (PR Branch Commit: 84a6d02) (Extended Tests: core(registry|imageapi|ImagePrune|ImageQuota))

@miminar
Copy link

miminar commented Jun 27, 2017

Ha .. I told you that extended tests need to be updated before merging #13428:

• Failure [18.035 seconds]
[Feature:ImagePrune] Image prune
/openshifttmp/openshift/build-rpm-release/tito/rpmbuild-originMSAd32/BUILD/origin-3.6.0/_output/local/go/src/github.com/openshift/origin/test/extended/images/prune.go:117
  of schema 1
  /openshifttmp/openshift/build-rpm-release/tito/rpmbuild-originMSAd32/BUILD/origin-3.6.0/_output/local/go/src/github.com/openshift/origin/test/extended/images/prune.go:75
    should prune old image [It]
    /openshifttmp/openshift/build-rpm-release/tito/rpmbuild-originMSAd32/BUILD/origin-3.6.0/_output/local/go/src/github.com/openshift/origin/test/extended/images/prune.go:74

    Expected
        <string>: application/vnd.docker.distribution.manifest.v2+json
    to equal
        <string>: application/vnd.docker.distribution.manifest.v1+json

Update: should be fixed in #14509

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 30, 2017

@miminar tested locally and it seems to work :-) i can see the docker-registry DNS in image streams after build/etc.

guess we are safe to merge?

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 30, 2017

@smarterclayton @bparees @jim-minter THIS is causing the new-app flake. See: https://gist.github.com/mfojtik/7720890674d2e7927ee00b3b25e090ca

We need this in and updated playbook to set this variable for our registry cc / @sdodson

[merge][severity:blocker]

@0xmichalis
Copy link
Contributor

Good catch! Do we need #14509 before this is merged?

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 84a6d02

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 30, 2017

@Kargakis i don't think so

@sdodson
Copy link
Member

sdodson commented Jun 30, 2017

@mfojtik just to be clear, this is all I should be setting, correct?
OPENSHIFT_DEFAULT_REGISTRY=docker-registry.default.svc:5000

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 30, 2017

@sdodson after this PR, yes (you have to set it for docker-registry DC, so the pod runs with this var set). You can then check the docker-registry pod log if it runs with proper registry url.

@openshift-bot
Copy link
Contributor

openshift-bot commented Jun 30, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/1185/) (Base Commit: faae9ac) (PR Branch Commit: 84a6d02) (Extended Tests: blocker) (Image: devenv-rhel7_6413)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants